<%-- 
    Document   : find
    Created on : 26.5.2014, 21:57:27
    Author     : Odin
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Vyhledání artefaktu podle metadat</title>
        <script type="text/javascript" src="assets/js/jquery-1.11.1.min.js"></script>
        <script type="text/javascript">
            $(function() {
                $(".add_restriction").click(function() {
                    var parent = $(this).closest("form");
                    var newRestrictionSelect = parent.find("select[name=restriction0_type]").clone();
                    newRestrictionSelect.attr("name", "restriction"+ $(".numOfRestrictions").val() +"_type");
                    newRestrictionSelect.appendTo(parent.find(".restrictions"));
                    parent.find(".restrictions")
                        .append(' <input type="text" name="restriction'+ $(".numOfRestrictions").val() +'_value">');
                    parent.find(".restrictions").append("<br>");
                    $(".numOfRestrictions").val(parseInt($(".numOfRestrictions").val())+1);
                    return false;
                });
            });
        </script>
    </head>
    <body>
        <a href="${pageContext.request.contextPath}/">&lt; Zpět na hlavní stranu</a><br>
        <h1>Vyhledání artefaktů podle metadat</h1>
        
        <form action="/find" method="POST">
            <strong>Artefakt ve formátu WAR</strong><br>
            <input type="hidden" name="numOfRestrictions" value="1" class="numOfRestrictions">
            <input type="hidden" name="format" value="war">
            Omezení metadat:<br>
            <div class="restrictions">
                <select name="restriction0_type">
                    <option value="filter">filter</option>
                    <option value="listener">listener</option>
                </select>
                <input type="text" name="restriction0_value"><br>
            </div>
            <a href="#" class="add_restriction">Přidat omezení</a><br>
            <input type="submit" value="Vyhledat"><br>
        </form>
        <br>
        <form action="/find" method="POST">
            <strong>Artefakt ve formátu WSDL</strong><br>
            <input type="hidden" name="numOfRestrictions" value="1" class="numOfRestrictions">
            <input type="hidden" name="format" value="wsdl">
            Omezení metadat:<br>
            <div class="restrictions">
                <select name="restriction0_type">
                    <option value="operation">operation</option>
                    <option value="message">message</option>
                </select>
                <input type="text" name="restriction0_value"><br>
            </div>
            <a href="#" class="add_restriction">Přidat omezení</a><br>
            <input type="submit" value="Vyhledat"><br>
        </form>
        <br>
        <form action="/find" method="POST">
            <strong>Artefakt ve formátu XSD</strong><br>
            <input type="hidden" name="numOfRestrictions" value="1" class="numOfRestrictions">
            <input type="hidden" name="format" value="xsd">
            Omezení metadat:<br>
            <div class="restrictions">
                <select name="restriction0_type">
                    <option value="complexType">complexType</option>
                    <option value="simpleType">simpleType</option>
                    <option value="element">element</option>
                    <option value="attribute">attribute</option>
                </select>
                <input type="text" name="restriction0_value"><br>
            </div>
            <a href="#" class="add_restriction">Přidat omezení</a><br>
            <input type="submit" value="Vyhledat"><br>
        </form>
        <br>
    </body>
</html>
